1. Field of the Invention
This invention pertains to a method of forming spotlight characteristics in order to impart a spotlight effect to objects graphically displayed by computer graphics technology, and to an image processing system wherein said method is employed.
2. Description of the Related Art
In recent years there has been a proliferation of image processing systems that employ computer graphics technology in graphically displaying objects placed in virtual three-dimensional space with multiple polygons. Research and development continues in efforts to make the displayed objects increasingly realistic.
One aspect of such computer graphics technology is shading process technology for imparting light illuminating effects on the surfaces of objects displayed. The impartation of special effects such as shining a spotlight onto an object is one method included among such shading processes.
The Open GL (trademark) method developed by Silicon Graphics is a technology for imparting spotlight characteristics that is known in the prior art. Referring to FIG. 1, if we consider a light vector L extending from a spot light source O in the direction of a prescribed point P, and a light-source axis vector D moving from the sport light source O toward the object, the Open GL (trademark) method designates parameters for the spotlight characteristics called "spotexp" and "cutoff" which are calculated by Equation 1 below. The spotlight effect characteristics at this time are as shown in the graph in FIG. 2. ##EQU1##
As shown in FIG. 2, when "spotexp" is made a large value, the spot becomes a spot having a narrowed shape. When actually used, however, in almost all cases the spot characteristics are considered in terms of spot spread angle. Accordingly, it is necessary to find by an inverse operation that "spotexp" at which the "spotEffect" will be at or below a certain value at the designated spot spread angle. Such inverse operations involve computational processing that is not simple.
And, even supposing that the value of "spotexp" has been determined by a reverse operation, the shape of the spot characteristic curve is different depending on the value of "spotexp," as seen in FIG. 2. For that reason, there is a danger that the result will be very different from the perception of an observer actually viewing the drawn image.
Furthermore, the shape of the spot characteristic curve is determined uniquely by the value of "spotexp," wherefore it cannot be designated independently of the spot spread and intensity distribution. As a consequence, it is not possible to obtain characteristics such that the spot spread is narrow, and the intensity distribution is roughly constant, as with a searchlight, and the result is an indistinct spot light.
The "cutoff" parameter, on the other hand, is such that, if some angle taken as a boundary is exceeded, the value of the "spotEffect" is taken as 0. Accordingly, it is a parameter which specifies an angle, and different from "spotexp," wherefore it is easy to control. The intensity distribution becomes discontinuous, however, so that only spotlight characteristics are obtainable wherewith the spot edge is sharp and the intensity distribution is constant. This constitutes a shortcoming.
In other words, "cutoff" is the limiting value of light spread which, if exceeded, results in the spot illuminating effect becoming zero. When a "cutoff" is established, this limiting region becomes conspicuous, which is a problem.
Meanwhile, there are also methods, including softimage developed by Microsoft, wherewith the fade-start angle (cone angle) and fade-end angle (spread angle) of the spot are designated, as diagrammed in FIG. 3. With this method, the spot characteristics are calculated using Equation 2 below. When this second method is used, since characteristics are designated with angles, control is easy and the calculations are simple. ##EQU2##
However, these characteristics are such as are diagrammed in FIG. 4, with variation in characteristic values being linear, so spot characteristics cannot be obtained resembling a proper curve such as with open GL (trademark).
Accordingly, there is a problem in that, as depicted in FIG. 3, an unnatural edge emphasis occurs at the position of the fade-start angle (cone angle). By edge emphasis here is meant a visual effect wherewith brightness variation is not continuous in regions adjacent to a boundary region, and the boundary brightness is emphasized.
A block diagram is given here, in FIG. 5, of one example of a conventional image processing system. In FIG. 5, a CPU 1 is for controlling the execution of programs for processing images using polygons. This CPU 1 reads out polygon data from a polygon buffer 11, and outputs to a coordinate converter 2.
The coordinate converter 2 converts polygon three-dimensional data to two-dimensional coordinates so that they can be displayed on a CRT display monitor 7. The polygon data coordinate-converted to two-dimensional coordinates are sent to a fill-in circuit 30 and a texture generator circuit 31.
The fill-in circuit 30 computes information on pixels that are within a range that is enclosed by the apexes of the polygons. The computation for the fill-in noted above performs linear interpolation, for example, on information on pixels between the polygon apexes, based on information on two corresponding apexes. The texture generator circuit 31 is a circuit that reads out texture corresponding to a pixel from an internal texture buffer, and determines colors for each pixel by computation. The output from the texture generator circuit 31 is sent as pixel data to the shading circuit 32.
The shading circuit 32 is a circuit for determining the spotlight-based illumination effects, such as noted above, that are based on the pixel data and imparted to the pixels. The output of the shading circuit 32 is sent to a color modulation circuit 12 and a mixing circuit 33. The color modulation circuit 12 is a circuit that does color modulation on each pixel, based on the results determined by the shading circuit 32, for example. The mixing circuit 33 mixes polygon pixel color information with color information drawn previously, writing these data in frames to a frame buffer 5. The information in this frame buffer 5 is displayed on the CRT display monitor 7.
Next is described a light source characteristic forming method that is conventionally implemented in the shading circuit 32 of an image processing system configured as described in the foregoing. In the example of the prior art diagrammed in FIG. 5, in some cases, four light source registers 329 and four corresponding light source arithmetical units (not shown) are configured in the shading circuit 32, which is capable of processing information from four light sources simultaneously.
In a case where light sources a, b, c, and d are used in one image scene, information on each light source, namely a, b, c, and d, is stored beforehand in the light source registers A, B, C, and D. The shading circuit 32 computes what kind of effect the light sources a, b, c, and d will have on each pixel based on the information on the light sources a, b, c, and d that is stored in the light source registers 329.
Light source information includes, for example, spot axial direction vectors (Dx, Dy, Dz), a cutoff angle (Cutoff), and fade width normalization coefficient (Penumbra scale), as described by either FIG. 1 or FIG. 3. The shading circuit 6 performs shading computations based on such light source data as these, adds the results together, and computes the effects that the four light sources have on each pixel.
Thus, with the prior art, light source registers 329 and light source arithmetical units in numbers exactly coinciding with the number of light sources that can be used in one image scene are provided. In general, the number of light sources in one image scene is the same as the number of light source registers 329 and light source arithmetical units. That being so, in the case where 100 light sources are used in one image scene, for example, 100 light source registers 329 and a like number of light source arithmetical units have to be provided, shading computations have to be performed from the 100 light sources, these results have to be added together, and the effects of 100 light sources have to be computed for each pixel. In terms of hardware size, however, this is not practicable.
If, on the other hand, the system is of a state-machine type, it is possible to increase the number of apparent light sources by sequentially rewriting the light source parameters, but this is difficult to manage. And in a system containing Z-sorts or the like, wherein polygon drawing order is not preserved, the number of apparent light sources cannot be increased.